package mediator.pattern.demo;

/**
 * Created by 逸足天涯
 * Date: 2019/10/17.
 * Time: 14:10
 */
public class MediatorPatternEx {
    public static void main(String[] args) {

        System.out.println("***Mediator Patten Demo***");

        ConcreteMediator m = new ConcreteMediator();

        Friend1 Amit = new Friend1(m, "Amit");
        Friend2 Jhon = new Friend2(m, "Jhon+");
        Boss pool = new Boss(m, "Pool");

        m.setFriend1(Amit);
        m.setFriend2(Jhon);
        m.setBoos(pool);

        Amit.send("[Amit:] Good Morning .Can we discuss the mediator Pattern");
        Jhon.send("[Jhon:] Good Morning.  Yes ,Can we discuss Now.");
        pool.send("\n [pool:] Please get back to work quickly");

    }
}
